/**
 * 
 */
package com.wegax.naming.interceptor;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.Phase;

import com.wegax.naming.register.NameRegister;


/**
 * @author wegax
 *
 */
class UserNameRemoveHttpHeaderInterceptor extends org.apache.cxf.phase.AbstractPhaseInterceptor<Message> {

	private final NameRegister nameRegister;
	
	public UserNameRemoveHttpHeaderInterceptor(NameRegister nameRegister) {
		super(Phase.SEND);
		this.nameRegister = nameRegister;
	}

	/* (non-Javadoc)
	 * @see org.apache.cxf.interceptor.Interceptor#handleMessage(org.apache.cxf.message.Message)
	 */
	@Override
	public void handleMessage(Message message) throws Fault {
		nameRegister.setName(null);
	}

}
